(a) Field of the Invention
The invention relates to a device and method for image processing, and particularly to a device and method for image compression and decompression.
(b) Description of the Related Art
Typically, the wide range of luminance levels found in real scenes may up to 100,000:1, which corresponds to information stored in high dynamic range (HDR) images. However, the human eye may sense a range of luminance levels only up to 10,000:1, which is narrower but is still broad enough to perceive tiny variations in luminance levels.
FIG. 1 shows a block diagram illustrating a conventional three dimensions (3D) graphic system 10. The 3D graphic system 10 includes a graphic processing device 11 and a memory 12. The graphic processing device 11 may be a 3D graphic card. The image data processed and stored by the 3D graphic system 10 are represented by fix-point numbers (i.e., integers), and thus only a narrow dynamic range of luminance levels between 0 and 1 can be obtained.
Taking an 8-bit fix-point number as an example, the value “00000000” is represented as “0.0f”, the value “11111111” is represented as “1.0f”, and thus its dynamic range is expressed as [0,1]. Since the fix-point number representation may only express a narrow dynamic range, the image rendered by the 3D graphic system 10 will be too dark or too bright as not to accurately reflect luminance variations in real scenes.
In order to improve the narrow dynamic range provided by the 3D graphic system 10, a 3D graphic system 20 that utilizes a floating-point number representation is proposed to process and store image data. Referring to FIG. 2A, the 3D graphic system 20 includes a graphic processing device 21 and a memory 22. The graphic processing device 21 may be a 3D graphic card. The operation and architecture of the 3D graphic system 20 is similar to the 3D graphic system 10, except the 3D graphic system 20 utilizes the floating-point number representation to process and store image data. Hence, a dynamic range of luminance levels obtained by the 3D graphic system 20 is expanded up to 100,000:1. Therefore, the 3D graphic system 20 can provide a high dynamic range (HDR) of luminance levels. The reason of how the floating-point number representation achieves a high dynamic range of luminance levels is described below.
First, a typical floating-point number is expressed as:sign[exp].man  (1.1)where “sign” is the sign bit 1 or −1, “exp” is the exponent, and “man” is the mantissa. Further, a numeral expression of a floating-point number can be written as:(−1)^sign*1.man*2^(exp−15)  (1.2)
For example, a floating number s[5]. 10 indicates the exponent is 5 and the mantissa is 10, and, substituting them into equation 1.2, the numeral value of the floating number s[5].10 is found to have a maximum of 131008. Hence, when a float-point number representation of s[5].10 is used in the 3D graphic system 20, the maximum numeral value that the 3D graphic system 20 can designate is 131008. Hence, a dynamic range of luminance levels obtained by the 3D graphic system 20 is expanded up to 100,000:1 so as to accurately reflect luminance variations in a real world.
FIG. 2B shows a block diagram illustrating the graphic processing device 21. The graphic processing device 21 includes a floating-point texture-loading unit 21a, a shader 21b, and a parameter adjusting unit 21c. The parameter adjusting unit 21c may be a rasterizer. The floating-point texture-loading unit 21a reads raw image data Or having a texture image format. Next, the shader 21b receives and then shades the raw image data Or. The parameter adjusting unit 21c receives and then adjusts the shaded raw image data Or′ and outputs an adjusted image data At to the memory 22. The adjusted image data At to be stored in the memory 22 is in a form of a rendered target image format. The parameter adjusting unit 21c adjusts the shaded raw image data Or′ by performing at least one operation of gamma correction, error correction, and color mixing. After stored the adjusted image data At, the memory 22 converts the adjusted image data At from a rendered target image format into a texture image format to improve image data access speed.
As described above, the 3D graphic system 20 utilizes a floating-point number representation to process and store image data so as to expand the dynamic range of the luminance levels. However, the occupied memory space required for the floating-point number representation is larger than that for a fix-point number representation, and thus the data amount handled by the graphic processing device 21 is considerably huge to lower its processing speed and increase occupied memory space. For example, in a ARGB format (A is a color-mixing value), a pixel P represented as a 8-bits fix-point number requires a data amount of 32 bits (=8*4) in graphic processing; however, the same pixel P represented as a 16-bits floating-point number requires a data amount of 64 bits (=16*4) in graphic processing. Thus, it is clearly seen the floating-point number representation for a pixel will largely occupy the memory space.
Hence, though the 3D graphic system 20 may achieve a high dynamic range of luminance levels, the huge data amount it processes and stores may in turn lower its processing speed and increase occupied memory space to result in an inferior performance.